package TempsJeu;

public class TempsJeu {

	private int _Hours;
	private int _Minutes;
	private int _second;

	public TempsJeu(int a_hours, int a_minutes, int a_second) {
		this._Hours = a_hours;
		this._Minutes = a_minutes;
		this._second = a_second;
	}

	public int get_Hours() {
		return _Hours;
	}

	public void set_Hours(int a_hours) {
		_Hours += a_hours;
	}

	public int get_Minutes() {
		return _Minutes;
	}

	public void set_Minutes(int a_minutes) {
		int tmp = this._Minutes + a_minutes;
		if (tmp >= 60) {
			this._Minutes = tmp - 60;
			set_Hours(1);
		} else
			this._Minutes += a_minutes;
	}

	public int get_second() {
		return _second;
	}

	public void set_second(int a_second) {
		int tmp = this._second + a_second;
		if (tmp >= 60) {
			this._second = tmp - 60;
			set_Minutes(1);
		} else
			this._second += a_second;
	}

	public String toString() {
		if (this._Hours != 0) {
			return ("temps de jeu : " + get_Hours() + " heure(s) "
					+ get_Minutes() + " minute(s) et " + get_second() + " seconde(s)");
		}
		return ("temps de jeu : " + get_Minutes() + " minute(s) et "
				+ get_second() + " seconde(s)");
	}

}
